package dao;

import util.DBMannager;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

public class VegetableDeleteDao {

    public boolean deleteVegetable(String vegetablename) throws SQLException {
        boolean flag = false;
        Connection connection= DBMannager.getConnection();
        PreparedStatement ps = null;
        String sql="delete from vegetable where vegename='"+vegetablename+"'";
        ps=connection.prepareStatement(sql);
        if(ps.executeUpdate()!=0){
            flag=true;
        }else {
            flag=false;
        }
        return flag;
    }

}
